<template>
	<div class="app-container">
		<el-tabs v-model="activeName">
			<el-tab-pane name="profile">
				<span slot="label"><i class="el-icon-date"></i> 个人资料</span>
				<doctor-profile :doctor="doctor" @getDoctor="getDoctor"></doctor-profile>
			</el-tab-pane>
			<el-tab-pane name="qualifications">
				<span slot="label"><i class="el-icon-picture-outline"></i> 资质信息</span>
				<doctor-qualifications :doctor="doctor"></doctor-qualifications>
			</el-tab-pane>
			<el-tab-pane name="patientEducation">
				<span slot="label"><i class="el-icon-tickets"></i> 患教内容</span>
				<patient-education :doctorId="doctor.doctorId"></patient-education>
			</el-tab-pane>
			<el-tab-pane name="examineEducation">
				<span slot="label"><i class="el-icon-document-checked"></i> 审核内容</span>
				<examine-education :doctorId="doctor.doctorId"></examine-education>
			</el-tab-pane>
			<el-tab-pane name="bindPatient">
				<span slot="label"><i class="el-icon-user"></i> 患者信息</span>
				<bind-patient-table :doctorId="doctor.doctorId"></bind-patient-table>
			</el-tab-pane>
			<el-tab-pane name="patientEvaluate">
				<span slot="label"><i class="el-icon-chat-line-square"></i> 患者评价</span>
				<patient-evaluate :doctorId="doctor.doctorId"></patient-evaluate>
			</el-tab-pane>
			<el-tab-pane name="doctorTask" v-if="false">
				<span slot="label"><i class="el-icon-discover"></i> 任务信息</span>
				<doctor-task :doctorId="doctor.doctorId" :sunshine="doctor.sunshine"></doctor-task>
			</el-tab-pane>
			<el-tab-pane name="pointEvent">
				<span slot="label"><i class="el-icon-collection"></i> 积分事件</span>
				<point-event :doctorId="doctor.doctorId" @getDoctor="getDoctor"></point-event>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
import { GetDoctorById } from '@/api/doctor'
import DoctorProfile from './doctor-profile'
import DoctorQualifications from './doctor-qualifications'
import PatientEducation from './patient-education'
import ExamineEducation from './examine-education'
import BindPatientTable from './bind-patient-table'
import PatientEvaluate from './patient-evaluate'
import DoctorTask from './doctor-task'
import PointEvent from './point-event'

export default {
	components: { DoctorProfile, DoctorQualifications, PatientEducation, ExamineEducation, BindPatientTable, PatientEvaluate, DoctorTask, PointEvent },
	data() {
		return {
			doctorId: undefined,
			doctor: {},
			activeName: 'profile'
		};
	},
	mounted() {
		this.doctorId = this.$route.query.doctorId;
		this.getDoctor();
	},
	methods: {
		getDoctor() {
			GetDoctorById(this.doctorId).then(res => {
				this.doctor = res.data;
			})
		}
	}
}
</script>

<style lang="scss" scoped>

</style>
